/*
 * $LastChangedDate: 2007-06-21 22:52:33 +0200 (Thu, 21 Jun 2007) $
 * $LastChangedRevision: 208 $
 * $LastChangedBy: david $
 */


#ifndef _CLIENT_H_
#define _CLIENT_H_

#include <iostream>
#include <ostream>
#include <string>

#include "Thread.h"
#include "ServerErrorException.h"
#include "Log.h"

class Log;

class Client : public Thread 
{
	friend class Log;
public:
	Client(std::string path, std::string mode);
	virtual ~Client();

	friend std::ostream & operator<<(std::ostream & os, const Client & c);

	static int numExecuting;
private:
	void parseAnswer(std::string s) throw(ServerErrorException &);
	virtual void run();
	std::string fpath;
	std::string fmode;
	std::string id;
	static int numClients;
	static int numOperations;
};

#endif /* _CLIENT_H_ */

